package stackdemo;

import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        stack.push(34);
        stack.push(45);
        stack.push(56);
        stack.push(67);

        System.out.println(stack);

        //拿出栈顶元素
        System.out.println(stack.pop());

        //只获取栈顶元素，不删除
        System.out.println(stack.peek());
        System.out.println(stack.peek());



    }
}
